<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<ul class="nav nav-list" id="menu">
	<c:forEach var="menu" varStatus="status" items="${menus}">
		<shiro:hasPermission name="${menu.permission}">
			<li>
				<a class="dropdown-toggle" href="javascript:void(0)">
					<i class="${menu.icon}"></i>
					<span class="menu-text"> ${menu.name} </span>
					<c:if test="${!empty menu.children}">
						<b class="arrow icon-angle-down"></b>
					</c:if>
				</a>
				<c:if test="${!empty menu.children}">
				<ul class="submenu">
					<c:forEach var="children" varStatus="status" items="${menu.sortChildren}">
						<shiro:hasPermission name="${children.permission}">
							<li>
								<a data-addtab="${children.id}" href="javascript:void(0)" url="${children.url}" title="${menu.name} - ${children.name}">
									<i class="${children.icon}"></i>
									${children.name}
								</a>
							</li>
						</shiro:hasPermission>
					</c:forEach>
				</ul>
				</c:if>
			</li>
		</shiro:hasPermission>
	</c:forEach>
</ul>
<script>
$(function(){
	$('#tabs').addtabs({contextmenu:true});
});
</script>